import request from '@/utils/request'
// 查询机构营销插件配置列表

export function qryMarketPlugins(scope, data) {
  return request({
    url: `/kd_manage/plugin/${scope}/page`,
    method: 'post',
    data: data
  })
}
// 营销插件-编辑功能
export function update(scope, data) {
  return request({
    url: `kd_manage/plugin/${scope}/update`,
    method: 'post',
    data: data
  })
}
// 营销插件-新增功能
export function plugAdd(scope, data) {
  return request({
    url: `/kd_manage/plugin/${scope}/add`,
    method: 'post',
    data: data
  })
}
// 营销插件-标签下拉框选择
export function qryTypeList(type) {
  return request({
    url: `kd_manage/plugin/qryTypeList`,
    method: 'get',
    params: {
      type: type
    }
  })
}

// 之前的⬇

export function queryFeatureList(scope, data) {
  return request({
    url: `/kd_manage/feature/${scope}/page`,
    method: 'post',
    data: data
  })
}

export function addFeature(scope, data) {
  return request({
    url: `/kd_manage/feature/${scope}/add`,
    method: 'post',
    data: data
  })
}

export function updateFeature(scope, data) {
  return request({
    url: `/kd_manage/feature/${scope}/update`,
    method: 'post',
    data: data
  })
}

export function getFeature(scope, featureId) {
  return request({
    url: `/kd_manage/feature/${scope}/info`,
    method: 'get',
    params: {
      featureId: featureId
    }
  })
}

export function deleteFeature(scope, featureId) {
  return request({
    url: `/kd_manage/feature/${scope}/delete`,
    method: 'post',
    data: {
      id: featureId
    }
  })
}

/* RFM */
// 保存分群配置
export function rfmSave(data) {
  return request({
    url: '/kd_manage/group/platform/save',
    method: 'post',
    data: data
  })
}
// 获取分群配置
export function getGroupPlatforms(data) {
  return request({
    url: '/kd_manage/group/platform/getGroupPlatforms',
    method: 'get',
    params: data
  })
}
// 修改分群配置
export function updateRfm(data) {
  return request({
    url: '/kd_manage/group/platform/update',
    method: 'post',
    data: data
  })
}
